package com.zhaiweijia.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.zhaiweijia.service.DamService;

@Controller
public class DamController {
	@Autowired
	public DamService service;
	
	@RequestMapping("list")
	public String findAll(@RequestParam(defaultValue = "1")Integer pageNum,Integer avgRain,Integer timeOfRain, Model model) {
		
		PageInfo info = service.findAll(pageNum,5,avgRain,timeOfRain);
		model.addAttribute("info", info);
		System.out.println(info);
		return "list";
		
		
	}
	
}
